Skip to content

fix(tmux): install CCB block into .tmux.conf.local for Oh My Tmux#98

Merged
bfly123 merged 1 commit intobfly123:mainfrom
HamsteRider-m:fix/wsl-clipboard-utf8
Feb 26, 2026
Merged

fix(tmux): install CCB block into .tmux.conf.local for Oh My Tmux#98
bfly123 merged 1 commit intobfly123:mainfrom
HamsteRider-m:fix/wsl-clipboard-utf8

Conversation

@HamsteRider-m
Copy link

@HamsteRider-m HamsteRider-m commented Feb 25, 2026

Background

  • We previously fixed WSL clipboard encoding issues in an earlier PR (the one you opened before), and that fix worked at the time.
  • After later updates, ccb update started doing a clean reinstall flow (CCB_CLEAN_INSTALL=1), which re-applies tmux integration during install.
  • In current main, tmux install logic still appends the CCB block to ~/.tmux.conf.

What Broke

  • For Oh My Tmux users, writing CCB config into ~/.tmux.conf can interfere with its internal reload/apply path (_apply_configuration) and cause reload errors like return 127.
  • So this is not only a local setup issue: it's a compatibility regression triggered by update/reinstall behavior.

Root Cause

  1. Clipboard behavior was fixed earlier.
  2. Later clean reinstall/update rewrote tmux config.
  3. Installer target location (~/.tmux.conf instead of ~/.tmux.conf.local for Oh My Tmux) caused the new failure.

Fix in This PR

  • Use a specific tmux marker (avoid broad marker false positives).
  • Detect Oh My Tmux (TMUX_CONF_LOCAL in main config).
  • Install CCB tmux block to ~/.tmux.conf.local for Oh My Tmux setups.
  • Keep default behavior for non-Oh-My-Tmux setups (still ~/.tmux.conf).
  • On install/uninstall, remove stale CCB blocks from both main/local files to avoid legacy leftovers.
  • Improve WSL clipboard path by prioritizing pwsh / powershell.exe in paste flow and keeping UTF-8-safe PowerShell copy pipeline.

Why This Matters

  • Prevents update-time regression: users who were previously fine should not break again after ccb update.
  • Aligns with Oh My Tmux conventions and CCB's stated compatibility.

Validation

  • bash -n install.sh
  • pytest -q test/test_tmux_backend.py test/test_tmux_respawn_pane.py test/test_ccb_tmux_split.py
  • Temp-HOME install simulation:
    • Oh My Tmux layout -> CCB block written to .tmux.conf.local
    • Non-Oh-My-Tmux layout -> CCB block written to .tmux.conf
    • Stale CCB block in .tmux.conf is cleaned on update

@bfly123 bfly123 merged commit d76db28 into bfly123:main Feb 26, 2026
3 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants